css check if class as color white

49

if( $(this).css("background-color").match(/^(?:white|#fff(?:fff)?|rgba?\(\s*255\s*,\s*255\s*,\s*255\s*(?:,\s*1\s*)?\))$/i))
    this.style.backgroundColor = "#000";

Comments

Submit
0 Comments